package com.hw.one.collect.heartbeat2;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.timeout.IdleStateHandler;

/**
 * @auther : 王振
 * @createtime:2018/10/25 9:57
 */
public class ClientHeart extends Thread  {
    @Override
    public void run() {

        try {
            while (true) {
                ClientSender.getInstance().send();
                synchronized (ClientHeart.class) {
                    // this.wait(5000);
                    Thread.sleep(2000);
                    System.out.println("--------------------发送心跳------------------");
                }
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 程序的入口main方法
     *
     * @param args
     */
    public static void main(String[] args) {
        ClientHeart client = new ClientHeart();
        client.start();
//        ChannelHandlerContext chc = new IdleStateHandler();



    }


}
